package com.cctv.fmaed.module.redis.memory.pojo.po;

import java.util.LinkedHashMap;

/**
 * 用户注册DTO
 *
 * @author heyingcheng
 * @since 2023/8/29
 */
public class UserRegisterPO extends LinkedHashMap<String, String> {

    public static final String HASH_KEY_USER_ID = "user_id";
    public static final String HASH_KEY_NICKNAME = "nickname";
    public static final String HASH_KEY_GUID = "guid";
    public static final String HASH_KEY_CREATE_TIME = "create_time";
    public static final String HASH_KEY_UPDATE_TIME = "update_time";

    public UserRegisterPO(String userId, String nickname) {
        put(HASH_KEY_USER_ID, userId);
        put(HASH_KEY_NICKNAME, nickname);

        String now = String.valueOf(System.currentTimeMillis());
        put(HASH_KEY_CREATE_TIME, now);
        put(HASH_KEY_UPDATE_TIME, now);
    }

    public String getUserId() {
        return get(HASH_KEY_USER_ID);
    }

    public String getNickname() {
        return get(HASH_KEY_NICKNAME);
    }

    public String getGuid() {
        return get(HASH_KEY_GUID);
    }

    public Long getCreateTime() {
        return Long.valueOf(get(HASH_KEY_CREATE_TIME));
    }

    public Long getUpdateTime() {
        return Long.valueOf(get(HASH_KEY_UPDATE_TIME));
    }

}
